/**
 * 检查登录
 */
var login = new Vue({
    el: "#admin",/*元素挂载点*/
    data: {
        onlogin: false,
        nickName:"",
        img:"",
        user:{}
    },
    mounted: function() {
        axios.get("/user/checkLogin").then(rt => {
            if (rt.status == 200) { // 说明请求成功
                if (rt.data.code == 200) { // 说明登录
                    this.user = rt.data.data.user;
                    this.onlogin = true;
                }
            } else {
                this.onlogin = false;
                window.location = "login.html";
            }
        })
    }
})
